package com.ptsolusi.ceriacrudwicket.tool.dataproviders;

import java.util.Collections;
import java.util.Iterator;
import java.util.List;

import org.apache.wicket.markup.repeater.data.IDataProvider;
import org.apache.wicket.model.IModel;

import com.ptsolusi.ceriacrudwicket.logic.OrderLogic;
import com.ptsolusi.ceriacrudwicket.model.OrderH;
import com.ptsolusi.ceriacrudwicket.tool.CeriacrudwicketApplication;

public class OrderDataProvider implements IDataProvider {
	
	private static final long serialVersionUID = 1L;
	private transient List<OrderH> list = null;
	private transient OrderLogic orderLogic = CeriacrudwicketApplication.get().getOrderLogic();
	
	@SuppressWarnings("unchecked")
	public Iterator<OrderH> iterator(int first, int count) {
		try {
			List<OrderH> slice = list.subList(first, first + count);
			return slice.iterator();
		}
		catch (Exception e) {
			e.printStackTrace();
			return Collections.EMPTY_LIST.iterator();
		}
	}
	
	

	public IModel model(Object arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	public int size() {
		// TODO Auto-generated method stub
		return 0;
	}

	public void detach() {
		// TODO Auto-generated method stub
		
	}

}
